Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODPart


InitPart

The InitPart method initializes this part object.

void InitPart (in ODStorageUnit storageUnit, 
               in ODPart partWrapper);
storageUnit
A reference to an empty storage unit to be used by this part as its primary persistent storage.
partWrapper
A reference to a part wrapper representing this part.
DISCUSSION
OpenDoc calls this method only once for the persistent lifetime of this part, when it is first created and has no stored data to read. After this method executes successfully, this part object is initialized and ready for use.

Your part's InitPart method, rather than its somInit method, should handle any initialization code that can potentially fail. Your part's InitPart method may attempt to allocate memory for your part instance, get resources that your part might need, or set up your part's persistent storage.

The inherited InitPart method creates and stores the kODPropCreateDate, kODPropModDate, and kODPropModUser properties; your part's storage unit automatically maintains the kODPropModDate and kODPropModUser properties.

OVERRIDING
When you subclass ODPart, you must override this method. Your override method must call its inherited method at the beginning of your implementation.

SEE ALSO
"The InitPart Method" on page 40 in OpenDoc Cookbook.
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"The InitPart Method" on page 293 in OpenDoc Programmer's Guide.
"The Part-Wrapper Object" on page 464 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help